From 7a814e85b43c88d8bde3b74a1916dc459abba670 Mon Sep 17 00:00:00 2001 From: "kaf24@freefall.cl.cam.ac.uk" Date: Tue, 21 Sep 2004 09:19:17 +0000 Subject: [PATCH] bitkeeper revision 1.1159.79.7 (414ff215B9qHlFD0mQm03ssF02V-uA) Strip image name from DOM0 cmdline. --- xen/arch/x86/domain.c | 2 +- xen/common/kernel.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index d58aa01b7e..ec27a5eb8d 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -862,7 +862,7 @@ int construct_dom0(struct domain *p, zap_low_mappings(); /* Do the same for the idle page tables. */ /* Give up the VGA console if DOM0 is configured to grab it. */ - console_endboot(strstr(cmdline, "tty0") != NULL); + console_endboot(cmdline && strstr(cmdline, "tty0")); /* DOM0 gets access to everything. */ physdev_init_dom0(p); diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 1baef5caa9..7b787a5536 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -148,7 +148,7 @@ void cmain(multiboot_info_t *mbi) { unsigned char *opt_end, *opt; while ( *cmdline == ' ' ) cmdline++; - cmdline = strchr(cmdline, ' '); + cmdline = strchr(cmdline, ' '); /* skip the image name */ while ( cmdline != NULL ) { while ( *cmdline == ' ' ) cmdline++; @@ -326,6 +326,15 @@ void cmain(multiboot_info_t *mbi) shadow_mode_init(); + /* Grab the DOM0 command line. Skip past the image name. */ + cmdline = (unsigned char *)(mod[0].string ? __va(mod[0].string) : NULL); + if ( cmdline != NULL ) + { + while ( *cmdline == ' ' ) cmdline++; + if ( (cmdline = strchr(cmdline, ' ')) != NULL ) + while ( *cmdline == ' ' ) cmdline++; + } + /* * We're going to setup domain0 using the module(s) that we stashed safely * above our heap. The second module, if present, is an initrd ramdisk. @@ -338,7 +347,7 @@ void cmain(multiboot_info_t *mbi) (mod[1].mod_start-mod[0].mod_start), (mbi->mods_count == 1) ? 0 : mod[mbi->mods_count-1].mod_end - mod[1].mod_start, - __va(mod[0].string)) != 0) + cmdline) != 0) panic("Could not set up DOM0 guest OS\n"); /* The stash space for the initial kernel image can now be freed up. */ -- 2.30.2